// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (C) 1993-1995  Microsoft Corporation.  All Rights Reserved.
//
//  MODULE:     REOleCb.h
//
//  PURPOSE:    <???>
//
//  PLATFORMS: 	Windows 95, Windows NT
//

#ifndef _REOLECB_H_
#define _REOLECB_H_

#include <ole2.h>
#include <richedit.h>
#include <richole.h>

class CRichEditOleCallback : public IRichEditOleCallback
{
protected:
	ULONG m_cRef;			// Object Reference Count
    HWND m_hwndEdit;        // Handle of the edit control that this class
                            //  is attached to.

public:
	// Constructors and Destructor
	__fastcall CRichEditOleCallback( HWND hwndEdit)
                : m_cRef(0), m_hwndEdit(hwndEdit) {};
	virtual __fastcall ~CRichEditOleCallback() {};

public:
	// IUnknown Interface Members
	STDMETHODIMP 		 QueryInterface(REFIID riid, LPVOID* ppv);
	STDMETHODIMP_(ULONG) AddRef(void);
	STDMETHODIMP_(ULONG) Release(void);

	// IRichEditOleCallback Interface Members
	STDMETHODIMP GetNewStorage(LPSTORAGE* ppStg);
	STDMETHODIMP GetInPlaceContext(LPOLEINPLACEFRAME* ppFrame,
								   LPOLEINPLACEUIWINDOW* ppDoc,
								   LPOLEINPLACEFRAMEINFO pFrameInfo);
	STDMETHODIMP ShowContainerUI(BOOL fShow);
	STDMETHODIMP QueryInsertObject(LPCLSID pclsid, LPSTORAGE pStg, LONG cp);
	STDMETHODIMP DeleteObject(LPOLEOBJECT pOleObj);
	STDMETHODIMP QueryAcceptData(LPDATAOBJECT pDataObj, CLIPFORMAT* pcfFormat,
								 DWORD reco, BOOL fReally, HGLOBAL hMetaPict);
	STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode);
	STDMETHODIMP GetClipboardData(CHARRANGE* pchrg, DWORD reco, 
								  LPDATAOBJECT* ppDataObject);
	STDMETHODIMP GetDragDropEffect(BOOL fDrag, DWORD grfKeyState,
								   LPDWORD pdwEffect);
	STDMETHODIMP GetContextMenu(WORD seltype, LPOLEOBJECT pOleObj,
							    CHARRANGE* pchrg, HMENU* phMenu);

};


#endif
